Skip to content

fix(acp): resolve conversation cwd from instance defaults#207

Merged
onutc merged 5 commits intomainfrom
docs-conversation-cwd-ownership
Apr 5, 2026
Merged

fix(acp): resolve conversation cwd from instance defaults#207
onutc merged 5 commits intomainfrom
docs-conversation-cwd-ownership

Conversation

@onutc
Copy link
Copy Markdown
Member

@onutc onutc commented Apr 4, 2026

TL;DR

This changes Spritz so conversations store only explicit cwd overrides while the backend resolves the effective working directory from the instance runtime defaults. It also repairs legacy copied defaults like /home/dev during bootstrap and returns effectiveCwd to the UI so reconnects stop falling back to stale conversation state.

Summary

  • add backend cwd resolution for ACP bootstrap and reconnect flows
  • expose effectiveCwd in bootstrap responses and conversation status
  • update the UI to trust backend-resolved cwd instead of spec.cwd
  • add regression tests for empty cwd clearing, legacy default normalization, and active-conversation bootstrap behavior
  • sync the conversation CRD schema copies

Review focus

  • legacy cwd normalization behavior during bootstrap
  • UI reconnect/bootstrap decision logic when effectiveCwd is missing
  • CRD/schema compatibility for the new conversation status field

Validation

  • cd api && go test ./...
  • cd operator && go test ./...
  • cd ui && pnpm typecheck
  • cd ui && pnpm test -- src/lib/acp-client.test.ts src/pages/chat.test.tsx
  • ./scripts/sync-crd.sh --check

@onutc onutc changed the title docs: define conversation cwd ownership model fix(acp): resolve conversation cwd from instance defaults Apr 4, 2026
@onutc
Copy link
Copy Markdown
Member Author

onutc commented Apr 4, 2026

Status update:

  • Runtime-owned conversation cwd resolution is implemented on this branch, including the Slack gateway follow-up.
  • Local validation completed:
    • cd api && go test ./...
    • cd operator && go test ./...
    • cd integrations/slack-gateway && go test ./...
    • cd ui && pnpm test -- src/lib/acp-client.test.ts src/pages/chat.test.tsx
    • ./scripts/sync-crd.sh --check
  • Staging deploy was triggered from platform run 23988121241 against Spritz commit 561fadf0747cc4faa10eee887b3b12e0cc697420. The Spritz deploy job completed successfully.
  • Live staging verification against the new spritz-api pods passed: I created a temporary ACP conversation on tcdev-tidy-tidepool, bootstrapped it through the staging API, and the response returned effectiveCwd=/workspace/platform with bindingState=active. The temporary conversation was deleted afterward.
  • The workflow's follow-on job Roll out concierge revision (staging) is still running as of this comment, so the overall GitHub Actions run has not reached a final conclusion yet.

@onutc onutc merged commit 977c948 into main Apr 5, 2026
10 checks passed
@onutc onutc deleted the docs-conversation-cwd-ownership branch April 5, 2026 05:49
@gitrank-connector
Copy link
Copy Markdown

⭐ GitRank PR Analysis

Score: 50 points

Metric Value
Component Other (1× multiplier)
Severity P1 - High (50 base pts)
Final Score 50 × 1 = 50

Eligibility Checks

Check Status
Issue/Bug Fix
Fix Implementation
PR Documented
Tests
Lines Within Limit

Impact Summary

This PR resolves a critical architectural issue where conversations stored ambiguous working directory values that could be either inherited defaults or explicit overrides, causing stale client state to override runtime defaults. The fix implements proper separation of concerns: instance owns defaults, conversations own explicit overrides, and the server resolves effective state. The changes affect bootstrap flows, reconnect behavior, UI state management, and integration clients (Slack gateway).

Analysis Details

Component Classification: This PR spans multiple architectural layers (API, operator CRD, UI, integrations) without fitting a single component category. It represents a fundamental architectural change to working directory ownership and resolution across the entire ACP system.

Severity Justification: This is a P1 (High) severity fix addressing a major architectural flaw where stale conversation state could override correct runtime defaults, causing incorrect working directory resolution during reconnects and bootstrap operations. The fix prevents data loss and ensures consistent behavior across all clients.

Eligibility Notes: Issue: True - PR fixes a reported architectural problem with conversation working directory handling. Fix Implementation: True - code changes comprehensively implement the described architecture with backend resolution, effective cwd exposure, and UI updates. PR Linked: True - detailed description with TL;DR, summary, validation steps, and architectural documentation. Tests: True - PR adds 275+ lines of tests covering legacy normalization, explicit overrides, bootstrap behavior, and UI reconnect logic. Tests Required: True - this is a critical bug fix in business logic (ACP bootstrap/reconnect) and API contract changes that require comprehensive test coverage to prevent regression.


Analyzed by GitRank 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant